import request from '@/utils/request'

// 配送相关

//  获取店铺配送开关状态
export async function getSettle(params: any) {
  return request('/api/backend/getSettle', {
    method: 'GET',
    params
  })
}

// 修改店铺配送开关状态
export async function saveDeliverySettings(data: any) {
  return request('/api/backend/saveDeliverySettings', {
    method: 'POST',
    data
  })
}

// 自提点列表
export async function backendOwnTakeList(params: any) {
  return request('/api/backend/backendOwnTakeList', {
    method: 'GET',
    params
  })
}

// 添加/编辑自提点
export async function saveOwnTake(data: any) {
  return request('/api/backend/saveOwnTake', {
    method: 'POST',
    data
  })
}

// 获取自提点详情
export async function getOwnTakeDetail(params: any) {
  return request('/api/backend/getOwnTakeDetail', {
    method: 'GET',
    params
  })
}

// 更新自提点状态
export async function updateOwnTakeStatus(data: any) {
  return request('/api/backend/updateOwnTakeStatus', {
    method: 'POST',
    data
  })
}

// 删除自提点
export async function deleteOwnTake(data: any) {
  return request('/api/backend/deleteOwnTake', {
    method: 'POST',
    data
  })
}

// 获取可用自提点数量
export async function getOwnTakeCount() {
  return request('/api/backend/getOwnTakeCount', {
    method: 'GET',
  })
}


// 获取可用自提点列表
export async function getActiveOwnTakeList() {
  return request('/api/backend/getActiveOwnTakeList', {
    method: 'GET',
  })
}